package com.kcs.dc.report.model.logic;

import java.sql.Connection;
import java.util.List;
import com.kcs.common.utils.ConnectionUtils;
import com.kcs.common.utils.Constant;
import com.kcs.common.utils.LogWriter;
import com.kcs.dc.report.model.dao.headermenuDAO;
import com.kcs.dc.report.model.dao.model.headermenuModel;

public class headermenuBL {
	private Connection conn = null;

	public headermenuBL(){
		
	}
	
	public List<headermenuModel> builtmenu(String user_id){
		LogWriter.debug("Headermenu: Built menu for login user", Constant.LOGGER_APPLICATION);
		
		List<headermenuModel> headermenuList = null;
		try{
			conn = ConnectionUtils.getConnection(Constant.MSSQL, Constant.TO);			
			headermenuDAO headerMenuDAO = new headermenuDAO();
   	 		headermenuList = headerMenuDAO.getListMenuOfLoginUser(user_id, conn);   	 		
		}catch(Exception e){
			LogWriter.error("Headermenu [Method : builtmenu] : " + e.getMessage(), Constant.LOGGER_APPLICATION);
		}finally{
			ConnectionUtils.closeConnection(conn);
		}
		return headermenuList;
	}
}
